//背景轮换
document.addEventListener("DOMContentLoaded", function () {
    let backgroundSlider = document.getElementById("bg");
    let images = [
        "url('/static/img/image1.jpg')",
        "url('/static/img/image2.jpg')",
        "url('/static/img/image3.jpg')"
    ];
    let index = 0;

    function changeBackground() {
        backgroundSlider.style.backgroundImage = images[index];
        index = (index + 1) % images.length; // 循环播放
    }

    changeBackground(); // 初始化背景图片
    setInterval(changeBackground, 10000); // 每10秒钟轮换一次背景图片
});